package ejb;

import java.util.List;

import javax.ejb.Stateless;

import dao.SubjectsDao;
import entity.Subjects;

@Stateless
public class SubjectsBean implements SubjectsBeanRemote, SubjectsBeanLocal {
	
	@Override
	public void insert(Subjects subject) {
		SubjectsDao.INSTANCE.save(subject);
	}

	@Override
	public void update(Subjects subject) {
		SubjectsDao.INSTANCE.merge(subject);
	}

	@Override
	public void delete(Subjects subject) {
		SubjectsDao.INSTANCE.delete(subject);
	}

	@Override
	public void get(Long id) {
		SubjectsDao.INSTANCE.findById(id);
	}

	@Override
	public List<Subjects> getAll() {
		return SubjectsDao.INSTANCE.findAll();
	}
}
